<!Doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="lib/esl.js"></script>
    <script src="lib/uglify.js"></script>

    <style type="text/css">
        body {
            margin: 0;
            text-align: center;
        }
        #log {
            height: 500px;
            overflow-y: scroll;

            width: 600px;
            text-align: left;
            margin: 0 auto;

            line-height: 18px;
        }
    </style>
</head>
<body>

    <h1 id="tip">
        代码构建中....
    </h1>
    <div id="log"></div>

    <script>

        var search = window.location.search;

        var BUILD_CONFIG = {};
        if (search) {
            search = search.slice(search.indexOf('?') + 1);
            var params = search.split('&');
            for (var i = 0; i < params.length; i++) {
                var keyValue = params[i].split('=');
                var key = decodeURIComponent(keyValue[0]);
                var value = decodeURIComponent(keyValue[1]);
                BUILD_CONFIG[key.toLowerCase()] = value;
            }
        }

        BUILD_CONFIG.version = +BUILD_CONFIG.version || 2;

        var postfix = (BUILD_CONFIG.dev ? '-dev' : '') + (BUILD_CONFIG.version === 2 ? '' : '-' + BUILD_CONFIG.version);

        require.config({
            packages: [{
                name: 'zrender',
                location: 'src/zrender' + postfix,
                main: 'zrender'
            }, {
                name: 'echarts',
                location: 'src/echarts' + postfix,
                main: 'echarts'
            }]
        });

        require(['app/build']);
    </script>
</body>
</html>